﻿using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;

namespace Linker.TaskCenter
{
    [DependsOn(
        typeof(TaskCenterApplicationContractsModule),
        typeof(AbpAspNetCoreMvcModule))]
    public class TaskCenterHttpApiModule : AbpModule
    {
        public override void PreConfigureServices(ServiceConfigurationContext context)
        {
            PreConfigure<IMvcBuilder>(mvcBuilder =>
            {
                mvcBuilder.AddApplicationPartIfNotExists(typeof(TaskCenterHttpApiModule).Assembly);
            });
        }

        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            // Disable MultiTenant
            context.Services.Configure<AbpMultiTenancyOptions>(options => { options.IsEnabled = false; });
        }
    }
}